//
//  GasStationTabBarVC.m
//  NtoccDriverNew
//
//  Created by niyongsheng on 2022/10/17.
//  Copyright © 2022 GCY. All rights reserved.
//

#import "GasStationTabBarVC.h"
#import "MCTabBar.h"

#import "GasHomeVC.h"
#import "GasMoneyVC.h"
#import "GasStationVC.h"
#import "ZTXGasHomeController.h"

@interface GasStationTabBarVC () <UITabBarControllerDelegate>
@property (nonatomic, strong) MCTabBar *mcTabbar;

@end

@implementation GasStationTabBarVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.delegate = self;
    
    [self addChildrenViewController:[[ZTXGasHomeController alloc] init] andTitle:@"首页" andImageName:@"gas_tabbar_home" andSelectImage:@"gas_tabbar_home_selected"];
//    [self addChildrenViewController:[[GasHomeVC alloc] init] andTitle:@"首页" andImageName:@"gas_tabbar_home" andSelectImage:@"gas_tabbar_home_selected"];
//    [self addChildrenViewController:[[GasMoneyVC alloc] init] andTitle:@"加油" andImageName:@"gas_tabbar_jiayou" andSelectImage:@"gas_tabbar_jiayou_selected"];
//    [self addChildrenViewController:[[GasStationVC alloc] init] andTitle:@"油站" andImageName:@"gas_tabbar_my" andSelectImage:@"gas_tabbar_my_selected"];
   
}

- (void)addChildrenViewController:(UIViewController *)childVC andTitle:(NSString *)title andImageName:(NSString *)imageName andSelectImage:(NSString *)selectedImage{
    childVC.tabBarItem.image = [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    childVC.tabBarItem.selectedImage =  [[UIImage imageNamed:selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    childVC.title = title;
    
    NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
    attributes[NSForegroundColorAttributeName] = [UIColor cy_colorWithHexString:@"#999999"];
    [childVC.tabBarItem setTitleTextAttributes:attributes forState:UIControlStateNormal];

    NSMutableDictionary *selectAttri = [NSMutableDictionary dictionary];
    selectAttri[NSForegroundColorAttributeName] = Theme_ColorValue;
    [childVC.tabBarItem setTitleTextAttributes:selectAttri forState:UIControlStateSelected];
    XPRootNavigationController *baseNav = [[XPRootNavigationController alloc] initWithRootViewController:childVC];
    
    [self addChildViewController:childVC];
}

@end
